package hr.riteh.assistivecommunicator;

import java.util.List;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class SentencesAdapter extends BaseListAdapter<Sentence>
{
	public SentencesAdapter(List<Sentence> list)
	{
		super(list);
	}

	@Override
	public long getItemID(Sentence sentence)
	{
		return sentence.getID();
	}

	@Override
	public View createView(ViewGroup parent)
	{
		return new TextView(parent.getContext());
	}

	@Override
	public void bindView(View view, Sentence sentence)
	{
		TextView textview = (TextView) view;
		textview.setText(String.format("%s (%d)", sentence.getContent(), sentence.getUsageCount()));
	}
}
